import React from 'react'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
import {actions} from '../../reducers/index'
import RegisterForm from './registerForm'
import './index.less'

class Register extends React.Component {
    render() {
        return(
            <RegisterForm
                register={this.props.register}
                openid={this.props.openid}
            />
        )
    }
}

function mapStateToProps(state) {
    return{
        userInfo: state.globalState.userInfo,
        openid: state.globalState.openid
    }
}

function mapDispatchToProps(dispatch) {
    return{
        register: bindActionCreators(actions.get_register, dispatch),
    }
}

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Register);